ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

FIND_PACKAGE(HDF4)

if (HDF4_FOUND)

SET(hdf4plugin_SOURCES
  hdf4plugin.cpp)

SET(hdf4plugin_HEADERS
  hdf4plugin.h)

#SET(hdf4plugin_RESOURCES hdf4.qrc)

#SET(hdf4plugin_FORMS ../../propertyeditor.ui)

QT4_WRAP_CPP(hdf4plugin_HEADERS_MOC ${hdf4plugin_HEADERS})
#QT4_WRAP_UI(hdf4plugin_FORMS_HEADERS ${hdf4plugin_FORMS})
#QT4_ADD_RESOURCES(hdf4plugin_RESOURCES_RCC ${hdf4plugin_RESOURCES})

INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})

INCLUDE_DIRECTORIES(${HDF4_INCLUDE_DIRS})

ADD_LIBRARY(hdf4plugin SHARED ${hdf4plugin_SOURCES} 
    ${hdf4plugin_HEADERS_MOC})

TARGET_LINK_LIBRARIES(hdf4plugin common
   ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES}
   ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${GLEW_LIBRARY}
   ${NETCDF_LIBRARIES_CXX} ${HDF4_LIBRARIES})

INSTALL (TARGETS hdf4plugin DESTINATION ${PLUGIN_INSTALL_DIR}/importplugins)

else()
MESSAGE( WARNING "Could not find HDF4 library, disabling hdf4 plugin")

endif (HDF4_FOUND)
